﻿<div class="portlet light bordered" ng-controller="app.views.tenantedit as vm">
    <div class="portlet-title">
        <div class="caption">
            <i class="icon-equalizer font-red-sunglo"></i>
            <span class="caption-subject font-red-sunglo bold uppercase">租户编辑</span>
            <span class="caption-helper">请编辑租户信息</span>
        </div>
    </div>
    <div class="portlet-body form">
        <!-- BEGIN FORM-->
        <form action="javascript:;" class="form-horizontal" name="tenancyForm" ng-submit="submit()">
            <div class="form-body">
                <div class="form-group">
                    <label class="col-md-3 control-label">名称</label>
                    <div class="col-md-4">
                        <input type="text" name="name" ng-model="tenantModel.name" required ng-minlength="2" ng-maxlength="50" class="form-control" placeholder="名称">
                        <span class="has-error" ng-show="tenancyForm.name.$error">
                            <span ng-show="tenancyForm.name.$error.minlength" class="help-block">该字段太短了.</span>
                            <span ng-show="tenancyForm.name.$error.maxlength" class="help-block">该字段太长了.</span>
                        </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">租户名字</label>
                    <div class="col-md-4">
                        @*<div class="input-group">*@
                        <input type="text" name="tenancyName" ng-model="tenantModel.tenancyName" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                        <span class="has-error" ng-show="tenancyForm.tenancyName.$error">
                            <span ng-show="tenancyForm.tenancyName.$error.minlength" class="help-block">该字段太短了.</span>
                            <span ng-show="tenancyForm.tenancyName.$error.maxlength" class="help-block">该字段太长了.</span>
                        </span>
                        @*</div>*@
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 control-label">是否激活</label>
                    <div class="col-md-4">
                        @*<div class="input-group">
                                <input ng-model="tenantModel.isActive" type="text" class="form-control" placeholder="Password">
                                <span class="input-group-addon">
                                    <i class="fa fa-user"></i>
                                </span>
                            </div>*@
                        @*<label class="control-label">是否激活</label>*@
                        <select ng-model="tenantModel.isActive" name="isActive" required ng-options="state.id as state.text for state in states" class="form-control">
                            @*<option value="true">激活</option>
            <option value="false">禁用</option>*@
                        </select>
                        @*<span class="help-block">
                               做出选择
                            </span>*@
                        <span class="has-error" ng-show="tenancyForm.isActive.$error">
                            <span ng-show="tenancyForm.isActive.$error.required" class="help-block">该字段必选.</span>
                        </span>
                    </div>
                </div>

                <div class="form-actions">
                    <div class="row">
                        <div class="col-md-offset-3 col-md-9">
                            <div class="row">
                                <div class="col-md-4">
                                    <button type="submit" class="btn green" ng-disabled="tenancyForm.$invalid">保存</button>
                                    <button type="button" onclick="history.back()" class="btn default">取消</button>
                                </div>
                                <div class="col-md-1">
                                    <button type="button" ng-show="tenantModel.id" ng-click="delete()" class="btn red">删除</button>
                                </div>
                            </div>


                        </div>
                    </div>
                </div>
        </form>
        <!-- END FORM-->
    </div>
</div>
